package com.lianbang.pharmacy.module.main

import android.content.Intent
import cn.ubest.mvvmcore.base.BaseActivity
import com.lianbang.pharmacy.R
import com.lianbang.pharmacy.databinding.ActivityStartBinding
import com.lianbang.pharmacy.module.user.LoginActivity
import com.lianbang.pharmacy.util.LoginUtils
import com.lianbang.pharmacy.vm.MainVM

/**
 * Created by maoqi on 2020/12/28.
 */
class StartActivity : BaseActivity<MainVM, ActivityStartBinding>() {
    override fun initLayout(): Int {
        return R.layout.activity_start
    }

    override fun initData(intent: Intent) {
    }

    override fun initView() {
        if (LoginUtils.isLogin()) {
            mViewModel.getUser()
        } else {
            LoginActivity.start(this)
            finish()
        }
    }

    override fun loadData() {
    }

}